package demo;
//演示 单例模式
//饿汉式单例
public class Hungry {
    // 可能会浪费空间
    private byte[] date1 = new byte[1024*1024];
    private byte[] date2 = new byte[1024*1024];
    private byte[] date3 = new byte[1024*1024];
    private byte[] date4 = new byte[1024*1024];

    private Hungry(){
    }

    private final static Hungry hungry = new Hungry();

    public static  Hungry getInstance(){
        return hungry;
    }


}
